package com.wc.alorithm_luogu._二分.P3743_kotori的设备;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/3/17 20:49
 * @description https://www.luogu.com.cn/problem/P3743
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 100010;
    static int[] a = new int[N];
    static int[] b = new int[N];
    static int n, p;

    // 能不能在有限的时间内把电充到位
    public static void main(String[] args) {
        n = sc.nextInt();
        p = sc.nextInt();
        long s = 0;
        for (int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
            s += a[i];
        }
        if (s <= p) out.println(-1);
        else {
            double l = 0, r = 1e10;
            // 这里最多1e-5就好了
            while (r - l > 1e-5) {
                double mid = (l + r) / 2;
                if (check(mid)) r = mid;
                else l = mid;
            }
            out.printf("%.9f", r);
        }
        out.flush();
    }

    static boolean check(double mid) {
        double t = 0;
        for (int i = 1; i <= n; i++) {
            if (a[i] * mid - b[i] > 0) {
                t += (a[i] * mid - b[i]) / p;
            }
        }
        return t >= mid;
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

